Recently, a die-to-database inspection technique has been suggested as a method of inspecting a pattern on a substrate for defects. According to this technique, an edge of a secondary electron image obtained by scanning the substrate with an electron beam is compared with an edge of a pattern of design data, and the amount of a deviance therebetween is inspected.
However, the die-to-database inspection has a problem of false defects that are frequently generated depending on the outer shape of the design pattern and a luminance change in the vicinity of an edge of a secondary electron pattern.
The problem of depending on the outer shape of the design pattern is caused when the design pattern includes a corner of a wiring line or a curve of a contact hole or the like. For example, if the die-to-database inspection is conducted on an inspection image of the wiring line including the corner, the corner is depicted in a rectangular shape on the design pattern, but the corner has a round curve shape in an actual pattern formed on the substrate. As a result, the distance of a deviance between the inspection target pattern and the design pattern is great in the corner. Thus, the corner is not actually a defect; nevertheless the corner may be detected as a defect (see reference numbers 80 and 81 in FIG. 6). If such a false defect is frequently generated, it is difficult to extract a true defect from an inspection result. This requires a considerable amount of time and effort to review and analyze the inspection result.
Furthermore, in a die-to-die inspection, a pattern edge has to be extracted from at least two or more secondary electron pattern images for comparison. However, there are pattern images having a small image value gradient (luminance change) in the vicinity of the pattern edge. It is difficult to determine an edge portion from such an image having a so-called blurred pattern edge. As a result, an error occurs in the detection of the position of the edge, leading to an increase of false defects. This is the problem of depending on the luminance change in the vicinity of the edge of the pattern image.